﻿<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title>Editor</title>
  <style type="text/css" media="screen">
    body {
        overflow: hidden;
    }
#editor {width:600px;height:500px;}
    #edi3tor {
        margin: 0;
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        right: 0;
    }
  </style>
</head>
<body>

<pre id="editor">
&lt;script&gt;
function foo(items) {
    var i;
    for (i = 0; i &lt; items.length; i++) {
        alert("Ace Rocks " + items[i]);
    }
}
&lt;/script&gt;
</pre>

<script src="ace.js" type="text/javascript" charset="utf-8"></script>
<script src="ext-language_tools.js" type="text/javascript" charset="utf-8"></script>
<script>
if(ace)
{


    var editor = ace.edit("editor");
    //editor.setTheme("ace/theme/twilight");
	//editor.setTheme("ace/theme/tomorrow");
    //editor.session.setMode("ace/mode/csharp");
    editor.session.setMode("ace/mode/html");
	}
</script>
<button onClick="alert(editor.getValue());">确定</button>
</body>
</html>
